let util = {
  openModal: (content) => {
    var modal = document.createElement('div')
    modal.id = 'httpModal'
    modal.innerHTML = '<i class=\'ivu-icon ivu-icon-close-circled\' style=\'color: #eb4449\'></i><span style=\'padding-left:12px\'>' + content + '</span>'
    document.body.appendChild(modal)
    setTimeout(function () {
      document.body.removeChild(modal)
    }, 1500)
  },
  parseDate (timestamp) {
    let date = new Date(timestamp)
    let Y = date.getFullYear() + '年'
    let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'
    let D = date.getDate() + '日'
    /* h = date.getHours() + ':'
        m = date.getMinutes() + ':'
        s = date.getSeconds() */
    return Y + M + D
  }
}
util.title = function (title) {
  title = title ? '测试系统-' + title : '测试系统'
  window.document.title = title
}

export default util
